package com.young.springdemo.controller;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "login")
public class TestLogin {

    @RequestMapping(value = "",method = RequestMethod.POST)
    public void login(){
        Subject subject = SecurityUtils.getSubject();
        if (subject.isAuthenticated()){
            System.out.println("欢迎");
        }else {
            System.out.println("请登录");
        }
    }
}
